package com.meida.module.bus.provider.service.impl;

import com.meida.common.base.entity.EntityMap;
import com.meida.common.mybatis.base.service.impl.BaseServiceImpl;
import com.meida.common.mybatis.model.ResultBody;
import com.meida.common.mybatis.query.CriteriaQuery;
import com.meida.common.mybatis.query.CriteriaSave;
import com.meida.module.bus.client.entity.VipUser;
import com.meida.module.bus.provider.mapper.VipUserMapper;
import com.meida.module.bus.provider.service.VipUserService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
 * vip用户表接口实现类
 *
 * @author flyme
 * @date 2022-06-30
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class VipUserServiceImpl extends BaseServiceImpl<VipUserMapper, VipUser> implements VipUserService {

    @Override
    public ResultBody beforeAdd(CriteriaSave cs, VipUser user, EntityMap extra) {
        return ResultBody.ok();
    }



    @Override
    @Transactional(propagation = Propagation.NOT_SUPPORTED, readOnly = true)
    public ResultBody beforePageList(CriteriaQuery<VipUser> cq, VipUser user, EntityMap requestMap) {
      cq.orderByDesc("user.createTime");
      return ResultBody.ok();
    }
}
